For vt-d's mmio address ranges, once ept enables, they should
be added to ept page tables with p2m lock held, and then guest can
access these ranges like conventional ram, but to change the ept
entries, it should take the p2m lock first.
Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
mfn_t mfn;
int order = 0;
+ p2m_lock(d->arch.p2m);
for ( gfn = start_gfn; gfn <= end_gfn; gfn++ )
{
e = ept_get_entry_content(d, gfn);
ept_set_entry(d, gfn, mfn, order, e.avail1);
}
}
+ p2m_unlock(d->arch.p2m);
}
/*
}
P2M_DEBUG("set mmio %lx %lx\n", gfn, mfn_x(mfn));
+ p2m_lock(d->arch.p2m);
rc = set_p2m_entry(d, gfn, mfn, 0, p2m_mmio_direct);
+ p2m_unlock(d->arch.p2m);
if ( 0 == rc )
gdprintk(XENLOG_ERR,
"set_mmio_p2m_entry: set_p2m_entry failed! mfn=%08lx\n",
"clear_mmio_p2m_entry: gfn_to_mfn failed! gfn=%08lx\n", gfn);
return 0;
}
+ p2m_lock(d->arch.p2m);
rc = set_p2m_entry(d, gfn, _mfn(INVALID_MFN), 0, 0);
+ p2m_unlock(d->arch.p2m);
return rc;
}